<template>
 <!-- 晨会智家看板 -->
  <div class="board-content">
    <board-title title="智家" bgclass="bg-zj">
      <img slot="flagImg" class="flag-img" src="~@/assets/imgs/publicline/board/flag_zj.png" />
    </board-title>
    <day-wise ref="dayWiseRef" v-show="flag" />
    <month-wise ref="monthWiseRef" v-show="!flag" />
  </div>
</template>

<script>
import boardTitle from '@/views/components/publicline/board/title.vue'
import dayWise from '@/views/components/publicline/board/dayWise.vue'
import monthWise from '@/views/components/publicline/board/monthWise.vue'

export default {
  components: { boardTitle, dayWise, monthWise },
  props: {
    flag: {
      type: Boolean,
      require: false,
      default: true
    }
  },
  methods: {
    getMorningWise(params) {
      if(this.flag) {
        this.$refs.dayWiseRef.getMorningDayWise(params)
      }
      if(!this.flag) {
        this.$refs.monthWiseRef.getMorningMonthWise(params)
      }
    },
  }
}
</script>
<style lang="less" scoped>
/deep/ .board-zj-info {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 16px;
  .board-zj-item {
    width: 45%;
    padding: 12px 0 8px 12px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    margin-bottom: 12px;
    &.bg1 {
      background-image: url('~@/assets/imgs/publicline/board/bg-card-zj-wjgh.png');
    }
    &.bg2 {
      background-image: url('~@/assets/imgs/publicline/board/bg-card-zj-wjzw.png');
    }
    &.bg3 {
      background-image: url('~@/assets/imgs/publicline/board/bg-card-zj-wjsy.png');
    }
    &.bg4 {
      background-image: url('~@/assets/imgs/publicline/board/bg-card-zj-iptv.png');
    }
    .sub-title {
      font-size: 12px;
      color: #999;
      margin-top: 6px;
    }
    .value {
      font-size: 24px;
      color: #FD806E;
      margin: 2px 0;
    }
    .unit {
      font-size: 14px;
    }
    .percent-title {
      font-size: 12px;
      color: #999;
      .percent {
        padding-left: 10px;
      }
      .up {
        color: #FF6024;
      }
      .down {
        color: #40BB3F;
      }
      img {
        width: 11px;
      }
    }
  }
}
</style>
